import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons';
import { connect } from 'react-redux';
import { updateCollapse } from '@/redux/modules/menu/action';
const CollapseIcon = (props: any) => {
	const { isCollapse, updateCollapse } = props;
	return (
		<i
			className='icon-class'
			onClick={() => {
				updateCollapse(!isCollapse);
			}}>
			{isCollapse ? <MenuUnfoldOutlined id='isCollapse' /> : <MenuFoldOutlined id='isCollapse' />}
		</i>
	);
};

const mapStateToProps = (state: any) => state.menu;
const mapDispatchToProps = { updateCollapse };
export default connect(mapStateToProps, mapDispatchToProps)(CollapseIcon);
